package cn.kgc.controller;

import cn.kgc.commons.vo.Result;
import cn.kgc.dto.add.SmsSpuAddDTO;
import cn.kgc.service.SmsSpuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @description: 商品对应活动的相关操作的控制器
 * @author: 石浩杰
 * @date: 2022-12-06 09:33
 */
@Api(tags = "商品对应活动的相关操作")
@RestController
@RequestMapping("/sms/spu")
@Validated
public class SmsSpuController {
    @Resource
    private SmsSpuService smsSpuService;

    @PostMapping("/save")
    @CrossOrigin
    @ApiOperation(value = "新增商品对应的活动", produces = "application/json;charset=utf-8",
            httpMethod = "POST", response = Result.class)
    public boolean saveSmsSpu(@RequestBody SmsSpuAddDTO smsSpuAddDTO) {
        return smsSpuService.addSmsSpu(smsSpuAddDTO);
    }
}
